   <%
           if(session.getAttribute("GioHang") == null || session.getAttribute("KhachHang") == null){
                    response.sendRedirect("index.jsp");
               }
           else
               {
           DTO_GioHang giohang = (DTO_GioHang)session.getAttribute("GioHang");

    %>
<%@page import="dto.DTO_SanPham"%>
<%@page import="java.util.ArrayList"%>
<%@page import="dto.DTO_GioHang"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="/struts-tags" prefix="s" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>GIỎ HÀNG</title>
         <link type="text/css" rel="stylesheet" href="css/style.css" />
        <link type="text/css" rel="stylesheet" href="css/nivo-slider.css" />
        <link type="text/css" rel="stylesheet" href="css/default/default.css" />
        <script type="text/javascript" src="js/jquery-1.5.2.js"></script>
        <script type="text/javascript" src="js/myJS.js"></script>
        <script type="text/javascript" src="js/jquery.nivo.slider.pack.js"></script>
    </head>
    <body>
        <div id="top-background">
             <div id="page-container">
                 <jsp:include page="template/header.jsp"></jsp:include>
                 <jsp:include page="template/navigation.jsp"></jsp:include>
                 <div id="main-content">
                     <div id="left-content">
                        <div class="title">
                            <p>Danh sách sản phẩm trong giỏ hàng</p>
                        </div>
                        <div id="left-content-inline">
                            <%
                                for(DTO_SanPham sp :giohang){
                            %>
                           
                            <div id="sanpham">
                                <div id="img">
                                    <img src="<%= sp.getHinhAnh() %>" alt="" style="max-height: 140px;max-width: 100px;"/>
                                </div>
                            </div>
                            <div id="chitiet_sanpham">
                                <div class="title">
                                    <p><%= sp.getTenSP() %></p>
                                </div>
                                <div id="noidung" >
                                    <p style="padding: 3px;"><%= sp.getThongTin() %></p>
                                </div>
                                
                            </div>
                            <div id="soluong_sp">
                                <div class="title">
                                    <p style="font-size: 13px;">Số lượng</p>
                                </div>
                                 <div style="margin:15px auto;padding-left: 10px;">
                                     <form name="sua" action="GioHang.action?action=update&id=<%=sp.getMaSP()%>" method="POST">
                                         <input type="text" value="<%=sp.getSoLuong()%>" name ="soluong" style="width: 25px;height: 20px;"/>
                                         <input type="submit" value="Sửa"/>
                                     </form>
                                    
                                  </div>
                            </div>
                            <div id="xoa_sp">
                                 <div class="title">
                                    <p style="font-size: 13px;text-align: center;">Xóa</p>
                                </div>
                                <div style="margin:0 auto;padding: 20px;">
                                    <a class="btnXoa" href="GioHang.action?action=remove&id=<%=sp.getMaSP()%>" style="padding: 10px;text-decoration: none;">Xóa</a>
                                </div>
                               
                            </div>
                            <div style="clear: both"></div>
                            
                            <%}%>
                           
                            
                            <div id="thanhtoan">
                                <div style="float:right;">
                                    <div id="tongsp">
                                        <p><font style="color:blue;font-weight: bold;">Tổng sản phẩm : </font> <font style="color:red;font-weight: bold;"><%= session.getAttribute("TongSP") %></font></p>
                                    </div>
                                    <div id="tongtien" >
                                          <p><font style="color:blue;font-weight: bold;">Tổng tiền : </font><font style="color:red;font-weight: bold;"><%= session.getAttribute("TongTien") %> VNĐ</font></p>
                                    </div>
                                    <div id="tongtien">
                                        <a href="index.jsp" style="padding-right: 15px;text-decoration: none;">Mua tiếp</a>
                                        <a href="thanhtoan.jsp" style="padding-right: 15px;text-decoration: none;">Thanh toán</a>

                                    </div>

                                </div>
                           <%}%>
                            </div>
                        </div>
                     </div>
                     <jsp:include page="template/right_content.jsp"></jsp:include>
                 </div>
                 <div style="clear: both;"></div>
                 <jsp:include page="template/footer.jsp"></jsp:include>
             </div>
        </div>
    </body>
</html>
